#pragma once 

#define BOOST_HAS_THREADS
#define BOOST_HAS_PTHREADS

namespace hc
{
	string HC_API now();

	class HC_API TWriter
	{
	public:
		virtual ~TWriter() {};
		virtual void WriteString( const string& iString ) = 0;
	};
	typedef boost::shared_ptr<TWriter>	PWriter;

	class HC_API TPermanentFileWriter: public TWriter
	{
	public:
		TPermanentFileWriter( const char* iName );
		~TPermanentFileWriter();
	
		virtual void WriteString( const string& iString );

	protected:
		std::ofstream m_log;
	};

	class HC_API TDebugConsoleWriter: public TWriter
	{
	public:
		virtual void WriteString( const string& iString );
	};


	class HC_API TDebugStream
	{
	public:
		TDebugStream();
		~TDebugStream();
		TDebugStream& WriteString( const string& iString );

		void AddWriter( PWriter iWriter );	
		void RemoveWriter( PWriter iWriter );
		bool GetEnabled() const;

	private:
		list<PWriter>	m_writers;
		TMutex			m_mutex;		
	};

	HC_API TDebugStream& Trace();
};

